d/rules: Normalize permissions of installed-tests
authorSimon McVittie <smcv@debian.org>
Fri, 20 Aug 2021 11:36:55 +0000 (12:36 +0100)
committerSimon McVittie <smcv@debian.org>
Fri, 20 Aug 2021 12:04:17 +0000 (13:04 +0100)
debian/rules

index 3f4dff895c816ce4205cf7bffcd4cdcd01d30831..4c5d26cfa8e69e2bf43ae3ca4639d4db4ca51223 100755 (executable)
@@ -75,11 +75,14 @@ override_dh_makeshlibs:
        # this is an LD_PRELOAD, not a real shared library
        dh_makeshlibs -Xinstalled-tests/ostree/libreaddir-rand.so
 
-override_dh_fixperms-arch:
-       # dh_fixperms assumes *.js are for browsers and makes them 0644.
-       dh_fixperms -X'*.js'
-       find debian/tmp -type f -name '*.js' -print0 | \
-               xargs -0r chmod -v go=rX,u+rw,a-s
+override_dh_fixperms:
+       dh_fixperms -Xusr/libexec/installed-tests
+ifneq ($(filter %-tests,$(binaries)),)
+       # debhelper >= 13.4 makes all of /usr/libexec executable, which is not
+       # quite right for installed-tests
+       chmod --changes u=rw,og=r debian/*-tests/usr/libexec/installed-tests/*/*.so
+       chmod --recursive --changes a+rX,u+w,og-w debian/*-tests/usr/libexec/installed-tests
+endif
 
 override_dh_installsystemd:
        dh_installsystemd --no-start